
package com.jf.cloud.biz.linstener;

import com.jf.cloud.biz.service.SendMessageService;
import com.jf.cloud.common.order.vo.SendNotifyBO;
import com.jf.cloud.common.rocketmq.config.RocketMqConstant;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author zz
 */
@Component
@RocketMQMessageListener(topic = RocketMqConstant.SEND_NOTIFY_TO_USER_TOPIC,consumerGroup = RocketMqConstant.SEND_NOTIFY_TO_USER_TOPIC)
public class SendNotifyToUserConsumer implements RocketMQListener<List<SendNotifyBO>> {

    @Autowired
    private SendMessageService sendMessageService;

    /**
     * 订单事件推送消息给用户
     */
    @Override
    public void onMessage(List<SendNotifyBO> notifyList) {
        sendMessageService.sendOrderNotifyMsgToUser(notifyList);
    }
}
